package com.ray.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;

import com.ray.bean.CompanyMaterialCountBean;

public interface CompanyMaterialCountMapper {
    
	//获取库存
	List<CompanyMaterialCountBean> getCompanyMaterialCountListByDetail(Map<String, Object> map);
	
	//修改库存
	int updateCompanyMaterialCountOnCountByMaterialCodeAndWarehouseType(CompanyMaterialCountBean companyMaterialCountBean);
	
	//新增库存信息
	int addCompanyMaterialCount(CompanyMaterialCountBean companyMaterialCountBean);
	
	//获取原料仓辅料仓合计库存
	CompanyMaterialCountBean getCompanyMaterialCountByMaterial(Map<String, Object> map);
	
	//获取库存信息(分页)
	List<CompanyMaterialCountBean> getCompanyMaterialCountListData(Map<String, Object> map);
	int getCompanyMaterialCountListCount(Map<String, Object> map);
	
	//通过出入库记录获取库存信息
	List<CompanyMaterialCountBean> getCompanyMaterialStackByWarehouseInOut(Map<String, Object> map);
	
	//获取库存物料的总额
	Double getCompanyMaterialCountPrice(Map<String, Object> map);
	
	//查重
	List<CompanyMaterialCountBean> duplicateCheck(Map<String, Object> unitMaterialMap);

	/**
	 * 获取订单库存
	 * @param map
	 * @return
	 */
	List<CompanyMaterialCountBean> getOrderMaterialStockCountData(Map map);
	int getOrderMaterialStockCountDataCount(Map map);

	/**
	 * 设置成品价格
	 * @param list
	 * @return
	 */
	int setFinishUnitPriceByList(@Param("list")List<CompanyMaterialCountBean> list);
	
}
